fix(vue-form): prevent full array re-renders in array mode#1963
fix(vue-form): prevent full array re-renders in array mode#1963imramkrishna wants to merge 4 commits intoTanStack:mainfrom
Conversation
|
|
View your CI Pipeline Execution ↗ for commit fd2732e
☁️ Nx Cloud last updated this comment at |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1963 +/- ##
==========================================
+ Coverage 90.35% 93.33% +2.97%
==========================================
Files 38 2 -36
Lines 1752 60 -1692
Branches 444 4 -440
==========================================
- Hits 1583 56 -1527
+ Misses 149 4 -145
+ Partials 20 0 -20 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
CI is green and coverage is fixed. |
|
Wait, I'm confused - shouldn't this be avoided as-of https://github.com/TanStack/form/releases/tag/%40tanstack%2Fvue-form%401.27.7 ? |
|
I checked the 1.27.7 changes and this does not reintroduce the behavior avoided there. The change in 1.27.7 avoids subscribing to the full field state to prevent unnecessary updates. If there’s a specific concern with multiple useStore subscriptions in Vue, I’m happy to adjust the approach. |
|
I see this mentions Vue but the behavior also happens in react |
|
@crutchcorn Yeah, it should be avoided, but while it is fixed in React, in Vue, it still re-renders each field after each change in any array field that significantly affects the performance. You could see the repro from the linked issue |
Closes #1961
Problem
In the Vue adapter,
useFieldcurrently subscribes to the entire field state via: